from .inputting import NoDefault, input_yes_or_no


class Rejection(Exception):
    pass


def confirm(prompt: str, *, default: bool = NoDefault):
    """ Asks the user to confirm an action. """
    if not input_yes_or_no(prompt, default=default):
        raise Rejection()
